<#include "/client/config.ftl"/>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no" />
		<title></title>
		<link rel="stylesheet" href="${base}/css/bootstrap.min.css" />
		<script type="text/javascript" src="${base}/js/jquery-1.12.0.min.js"></script>
		<link rel="stylesheet" href="${base}/css/common.css" />
	</head>

	<body>
		<div class="container-fluid">
			<fieldset disabled>
			<ul>
				<li class="list_each no_border">
					<div class="item">
						<span class="key">姓名：</span>
						<span class="value">${task.sikerName}</span>
					</div>
				</li>
				<li class="list_each no_border">
					<div class="item">
						<span class="key">所属组：</span>
						<span class="value">${task.groupName}</span>
					</div>
				</li>
				<li class="list_each no_border">
					<div class="item">
						<span class="key">任务内容：</span>
						<#if task.tsType == 1>
							<span class="value">疼痛评估任务</span>
						<#elseif task.tsType == 2>
							<span class="value">不良反应反馈任务</span>
						<#elseif task.tsType == 3>
							<span class="value">依从性评价任务</span>
						<#elseif task.tsType == 4>
							<span class="value">健康评估任务</span>
						<#elseif task.tsType == 5>
							<span class="value">滴定任务</span>
						<#else>
							<span class="value">服药提醒任务</span>
						</#if>
					</div>
				</li>
				<#list task.task as hl>
					<li class="list_each no_border">
						<#if hl.tiNo == 1>
							<h1>1、您从事一些费力的活有苦难吗？比如提很重的物品。</h1>
						<#elseif hl.tiNo == 2>
							<h1>2、长距离行走对您来说有困难吗？</h1>
						<#elseif hl.tiNo == 3>
							<h1>3、户外短距离行走对您来说有困难吗？</h1>
						<#elseif hl.tiNo == 4>
							<h1>4、您白天需要呆在床上或者椅子上吗？</h1>
						<#elseif hl.tiNo == 5>
							<h1>5、您在穿衣、吃饭、洗澡需要他人帮忙吗？</h1>
						<#elseif hl.tiNo == 6>
							<h1>6、您在工作日或者日常活动中是否收到限制？</h1>
						<#elseif hl.tiNo == 7>
							<h1>7、您在从事您的爱好和日常休闲活动中是否有受到限制？</h1>
						<#elseif hl.tiNo == 8>
							<h1>8、您有气短吗？</h1>
						<#elseif hl.tiNo == 9>
							<h1>9、您有疼痛吗？</h1>
						<#elseif hl.tiNo == 10>
							<h1>10、您需要休息吗？</h1>
						<#elseif hl.tiNo == 11>
							<h1>11、您睡眠有苦难吗？</h1>
						<#elseif hl.tiNo == 12>
							<h1>12、您觉得虚弱吗？</h1>
						<#elseif hl.tiNo == 13>
							<h1>13、您食欲不振（没有胃口）吗？</h1>
						<#elseif hl.tiNo == 14>
							<h1>14、您觉得恶心吗？</h1>
						<#elseif hl.tiNo == 15>
							<h1>15、您有呕吐吗？</h1>
						<#elseif hl.tiNo == 16>
							<h1>16、您有便秘吗？</h1>
						<#elseif hl.tiNo == 17>
							<h1>17、您有腹泻吗？</h1>
						<#elseif hl.tiNo == 18>
							<h1>18、您觉得累吗？</h1>
						<#elseif hl.tiNo == 19>
							<h1>19、疼痛影响您的日常活动吗？</h1>
						<#elseif hl.tiNo == 20>
							<h1>20、您集中精力做事有困难吗，比如看报或者看电视？</h1>
						<#elseif hl.tiNo == 21>
							<h1>21、您觉得紧张吗？</h1>
						<#elseif hl.tiNo == 22>
							<h1>22、您觉得忧虑吗？</h1>
						<#elseif hl.tiNo == 23>
							<h1>23、您觉得脾气暴躁吗？</h1>
						<#elseif hl.tiNo == 24>
							<h1>24、您觉得压抑（情绪低落）吗？</h1>
						<#elseif hl.tiNo == 25>
							<h1>25、您感到记忆困难吗？</h1>
						<#elseif hl.tiNo == 26>
							<h1>26、您的身体状况或者治疗影响您的家庭生活吗？</h1>
						<#elseif hl.tiNo == 27>
							<h1>27、您的身体状况或者治疗影响您的社交活动吗？</h1>
						<#elseif hl.tiNo == 28>
							<h1>28、您的身体状况或者治疗使您陷入经济困难吗？</h1>
						<#elseif hl.tiNo == 29>
							<h1>29、您如何评价在过去一星期内您总的健康情况？</h1>
						<#else>
							<h1>30、您如何评价在过去一星期内您总的生命质量？</h1>
						</#if>
						<div class="page_right">
							<#if hl.tiNo == 29 || hl.tiNo == 30>
								<img class="img_sty" src="${base}/image/hl-level.png"/>
								答案 ：${hl.tiValue}
							<#else>
								答案：
								<#if hl.tiValue == 1>
									1 没有
								<#elseif hl.tiValue == 2>
									2 有点
								<#elseif hl.tiValue == 3>
									3 相当
								<#else>
									4 苦难
								</#if>
							</#if>
						</div>
					</li>
				</#list>
				<li class="list_each no_border">
					<div class="item">
						<span class="key">执行日期：</span>
						<span class="value">${task.strDate}</span>
					</div>
				</li>
				<li class="list_each no_border">
					<div class="item">
						<span class="key">任务状态：</span>
						<#if task.status == 2>
							<span class="value">已完成</span>
						<#elseif task.status == 5>
							<span class="value">已完成（助手已阅）</span>
						<#elseif task.status == 6>
							<span class="value">已完成（药师已阅）</span>
						<#elseif task.status == 7>
							<span class="value">已完成（医生已阅）</span>
						<#elseif task.status == 9>
							<span class="value">已完成（助手、药师已阅）</span>
						<#elseif task.status == 10>
							<span class="value">已完成（助手、医生已阅）</span>
						<#elseif task.status == 11>
							<span class="value">已完成（药师、医生已阅）</span>
						<#elseif task.status == 14>
							<span class="value">已完成（助手、药师、医生已阅）</span>
						</#if>
					</div>
				</li>
			</ul>
			</fieldset>
			<#if user?exists>
			<#else>
				<#if (doctor?exists && (task.status == 7 || task.status == 10 || task.status == 11)) || (assitant?exists && (task.status == 6 || task.status == 9 || task.status == 11)) || (pharmacist?exists && (task.status == 5 || task.status == 9 || task.status == 10)) || (task.status == 14 && (doctor?exists || assitant?exists || pharmacist?exists))>
					<div class="form-group login_reg_btn mar_top mar_bottom">
						<button class="btn btn-primary" disabled>已批阅</button>
					</div>
				<#else>
					<div class="form-group login_reg_btn mar_top mar_bottom">
						<button id="checkup" class="btn btn-primary">批阅</button>
						<div class="hidden_area">
							<input type="hidden" value="${task.tsId}" id="tsId">
						</dvi>
					</div>
				</#if>
			</#if>
		</div>
		<script>
			$(document).ready(function(){
				<#if user?exists>
				<#else>
					$("#checkup").click(function(){
						var tsId = $("#tsId").val();
						$.ajax({
							type:"get",
							<#if doctor?exists>
								url:"${base}/client/task/checkupByDoctor",
							<#elseif assitant?exists>
								url:"${base}/client/task/checkupByAssi",
							<#else>
								url:"${base}/client/task/checkupByPhar",
							</#if>
							dataType:"json",
							data:{
								"tsId":tsId
							},
							success:function(data){
								if(data.result == "success"){
									alert("批阅完成");
									$("#checkup").text("已批阅");
									$("#checkup").attr("disabled","disabled");
								}else{
									alert("批阅失败");
								}
							}
						});
					});
				</#if>
			});
		</script>
	</body>

</html>